# Deploying WordPress application using Nimble persistent volume

Create the required PVC for the deployment.

> kubectl create --f mariadb-pvc.yaml wordpress-pvc.yaml

Sample pvc files are as follows.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: data-my-wordpress-mariadb-0
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
  storageClassName: hpe-standard

PVC for the Wordpress application.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-wordpress
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
  storageClassName: hpe-standard

Use Helm to deploy WordPress using the PVC created previously. When WordPress is deployed, the volume will be attached, formatted, and mounted.

  1. Add the WordPress chart.
> helm repo add bitnami https://charts.bitnami.com/bitnami
> helm repo update
  1. Deploy WordPress by setting persistence.existingClaim=<existing_PVC> to the PVC  my-wordpress created in the previous step.
> helm install my-wordpress bitnami/wordpress --version 9.2.1 --set service.type=ClusterIP,wordpressUsername=admin,wordpressPassword=adminpassword,mariadb.mariadbRootPassword=secretpassword,persistence.existingClaim=my-wordpress,allowEmptyPassword=false
>kubectl get pods
NAME READY STATUS RESTARTS AGE
my-wordpress-69b7976c85-9mfjv 1/1 Running 0 2m
my-wordpress-mariadb-0 1/1 Running 0 2m

> kubectl describe svc wordpress
Name: wordpress
Namespace: default
Labels: app=wordpress
hpecp.hpe.com/hpecp-internal-gateway=true
Annotations: hpecp-internal-gateway/80: hcpgw1.twentynet.local:10003
Selector: app=wordpress,tier=frontend
Type: NodePort
IP: 10.96.129.177
Port: <unset> 80/TCP
TargetPort: 80/TCP
NodePort: <unset> 31535/TCP
Endpoints: 10.192.0.164:80
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>

Open a browser on your workstation to hcpgw1.twentynet.local:10003 and you should see, "Hello World!".